package com.example.logistics_manage.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.OSSClientBuilder;
import lombok.Data;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
@Data
@ConfigurationProperties(prefix = "config.oss")
public class OssConfig {
    private String endpoint;
    private String accessKeyId;
    private String accessKeySecret;
    private String bucketName;

//    @Bean
//    @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE )
//    public OSS getOSS(){
//        OSS ossClient = new OSSClientBuilder().build(this.getEndpoint(),this.getAccessKeyId(),this.getAccessKeySecret());
//        return ossClient;
//    }
}
